home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-20
/
rs0422.zip
/
LEVEL1
/
BOOT.AS
next >
Wrap
Text File
|
1989-12-09
|
7KB
|
216 lines
;/*
; * Copyright 1988 by the Radio Amateur Telecommunications Society
; * and Thomas A. Moulton, W2VY
; *
; * This software may only be modified, copied, distributed or
; * executed for non-profit purposes by individuals operating
; * systems in the Amateur Radio Service. Credit to the
; * author(s) and to the Radio Amateur Telecommunications Society
; * must be made in modules where RATS provided software is used,
; * and in any announcements and documentation.
; *
; * As a non-profit, research and development organization, the
; * Radio Amateur Telecommunications Society distributes software
; * in both executable and source forms. This policy is in place
; * to encourage the development and distribution of OSI-based,
; * networking tools. In order to protect the interests of the
; * Society and the authors, we have placed some conditions
; * of use on the software. Other groups are encouraged
; * to place the same or similar guidelines on
; * software they produce.
; *
; * The Radio Amateur Telecommunications Society reserves the right
; * to specify and alter the terms under which software provided by
; * the Society may be used. This policy is consistent with the
; * objective of uniform and consistent "Open Systems Interconnections."
; *
; * All acceptable Amateur Radio related uses of this software
; * will be outlined in the "ROSE Implementer's Guide". Individuals
; * or organizations wishing to add to, or modify the provisions of
; * the guide to accommodate local or evolutionary requirements
; * should document the proposed change(s) and forward them to the
; * Society. If accepted, written notification will be provided by
; * the Society to the submitting organization or individual(s).
; * The Society will then issue a "ROSE Implementer's Guide Change
; * Notice". Periodically, the Society will re-issue the "ROSE
; * Implementer's Guide" and incorporate the text of the change
; * notices. This procedure has been put in to place to ensure
; * compatibility between systems and to ensure their "Openness"
; * and interoperability.
; *
; * No part of this software may be used in other packages
; * without prior authorization from the author or the Society.
; * Software incorporating this module, all or in part, must be
; * provided to the Society prior to distribution or use by
; * anyone not directly involved in testing of the revised
; * environment. Current releases of the combined software must
; * be provided to the Society in both source and executable
; * forms. Adequate documention to produce an executable module
; * from the provided source must also be included.
; *
; * Non-Amateur Radio non-profit uses may be authorized on a case
; * by case basis. Inquiries for such use may be made in writing
; * to the Society. Non-commercial uses consistent with the
; * general principles of Open Systems Interconnection Reference
; * Model will be generally considered with favor.
; *
; * Commercial licensing of the software is also available based
; * on normal commercial terms. Licensing inquiries should be
; * directed to the Society. Commercial licensing of the standard
; * software will be done in situations which materially benefit
; * the Amateur Radio Packet Network. Additional licensing is
; * reserved by the individual authors.
; *
; * The Radio Amateur Telecommunications Society provides this software
; * on an "as is" basis. The Society assumes no liability for
; * loss incurred through the use of this software. Amateur Radio
; * use of this software implies non-commercial and voluntary
; * development, deployment and use of this software in a "Amateur",
; * non-commercial service. Commercial users are encouraged to
; * inspect their copies of the source code. Source code modification
; * licenses are available if a combined Object and Source Code
; * license was not originally established.
; *
; * The Society may be contacted by writing or calling at:
; *
; * The Radio Amateur Telecommunications Society
; * 206 North Vivyen Street.
; * Bergenfield, New Jersey 07621
; *
; * Telephone: 201-387-8896
; *
; */
;
; System Init for ROM
;
*INCLUDE RCONFIG.LIB
psect text
global __init, _MEMSIZ, _COLD
global _main, start, __Hbss, __Lbss, __Lbssck
global HDWINT, QUEUE, csv, cret, rcsv
global mycall, mydigi, myaddr, _dl2parms
global _dl3parms, _being_set, _complete
start: DEFW mycall, mydigi, myaddr, _dl2parms
DEFW _dl3parms,_being_set,_complete,-1
DEFW -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
DEFW -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
DEFW -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
DEFW -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
DEFW -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
DEFW -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
DEFW -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
DEFW -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
DEFW -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
DEFW -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
;The next location should be 0150H
INIT_HDW EQU 0004H
INIT_LED EQU 0007H
UPD_LED EQU 000AH
POWER_FAIL:
LD A,(_COLD) ;Why are we here?
EX AF,AF' ;Save it in alt reg set
ld hl,__Lbss ;Start of RAM
ld ix,0 ;checked 0 bytes so far
ld b,0ffh
ld c,0
sizlop: ld (hl),0
ld a,c
cp (hl)
jp nz,cleared ;not RAM, done
dec (hl)
ld a,b
cp (hl)
jp nz,cleared ;not RAM, done
ld a,(__Lbssck) ;Did memory wrap yet?
cp b
jp z,cleared ;memory wrapped on itself
inc ix ;Count one more byte
ld (hl),0 ;Clear it
inc hl
jp sizlop
cleared:
dec hl
dec hl
ld sp,hl ;Set stack to top of mem
push ix ;Save memsize (in IX) for later
pop de
ld hl,__Hbss
ld bc,__Lbss
xor a ;Clear carry
sbc hl,bc ;RAM Used by the code
ex de,hl
xor a
sbc hl,de ;Total RAM for Heap/Stack
ld (_MEMSIZ),hl ;Save the Ram Size for _spclev()
ld hl,NSLOT
ld (QUEUE),hl ;Init the QUEUE header for OS_TASK
ex af,af' ;Get Cold Start Flag
ld (_COLD),a
global __init
call __init
;
call HDWINT
call _main
XOR A
LD (_COLD),A ;We did?! Error 00 (Both ON)
jp start ;it shouldn't ever return...
global _service_timers
global _main, SETTMR
_main:
LD A,(_COLD) ;Why did we restart?
LD B,A ;COLD=00h, Power Failure
;COLD=40h, Calling _free from OS_TASK (NOT USED)
;COLD=80h, Bad Vector in SETTMR/TICK
;COLD=C0h, Died while Running a process
CALL INIT_LED ;Init the Led's based on A
LD A,0
LD (_COLD),A ;Toggle the LEDS in 3 Sec so we can see them
;
ld de,0 ;No arg
ld hl,timedone ;routine
ld bc,303 ;101 x 9.9ms ticks = 909ms (1 Sec) timer
ld a,NUMCH ;pseudo channel for the 1 sec timer
call SETTMR
global _init
ld hl,_init ; init l2/l3
ld a,0 ;no args
call OS_QUE
1: call OS_TASK
jp 1b
global OS_TASK, OS_QUE
timedone:
ld de,0 ;No arg
ld hl,timedone ;routine
ld bc,101 ;101 x 9.9ms ticks = 909ms (1 Sec) timer
ld a,NUMCH ;pseudo channel for the 1 sec timer
call SETTMR
ld hl,UPD_LED ;Toggle LED's
ld a,0 ;no args
call OS_QUE ;queue it to happen soon
ld hl,_service_timers ;routine to call
ld a,0 ;no args
call OS_QUE ;queue it to happen soon
ret
psect bss
global HDWbss
HDWbss: defs 8 ;Some spare ram for machine dep...
end 0000